package com.example.service;

import com.example.mapper.EntityDao;
import com.example.entity.EduTeacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService{
    @Autowired
    private EntityDao entityDao;
    @Autowired
    private StreamBridge streamBridge;
    @Override
    public List<EduTeacher> teachers() {
        List<EduTeacher> teachers = entityDao.teacherList();
        return teachers;
    }

    @Override
    public void produceMessage(String msg,String msg1) {
        streamBridge.send("produceMessage-in-0",msg);
        streamBridge.send("produceMessage-in-0",msg);
    }
}
